package com.ys.web.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.ys.web.remotemodel.ContractInfo;
import com.ys.web.remotemodel.CustomerInfo;
import com.ys.web.service.BusinessSupportService;

/**
 * 业务支持
 * @author wdj
 *
 */
@Scope("prototype")
@Controller
@RequestMapping("/businessSupportController")
public class BusinessSupportController {

	@Autowired
	@Qualifier("businessSupportService")
	private BusinessSupportService businessSupportService;
	
	@RequestMapping(params="showCompanyMsg")
	public ModelAndView showCompanyMsg(HttpServletRequest request){	
		return new ModelAndView("businessSupport/companyMsgList");
	}
	
	/**
	 * 获取付费客户信息
	 * @return
	 */
	@RequestMapping(params="getAllCompanyMsg")
	@ResponseBody
	public List<CustomerInfo> getAllCompanyMsg() {
		List<CustomerInfo> list = businessSupportService.getALLCustomerInfoByJeecg();		
		return list;
	}
	
	/**
	 * 根据用户id查找合同相关信息
	 * @param userId
	 * @return
	 */
	@RequestMapping(params="getContractInfoByUserId")
	@ResponseBody
	public List<ContractInfo> getContractInfoByUserId(String userId) {
		List<ContractInfo> list = businessSupportService.getContractInfoByUserId(userId);		
		return list;
	}
	
	
	
}
